class Event < ActiveRecord::Base
  validates_format_of :date, 
                      :with => /^[0-9]{4}[-][0-9]{2}[-][0-9]{2}$/ ,
                      :message => "is missing or invalid. Please enter a valid date in this format: yyyy-mm-dd."
                      
  validates_numericality_of :fees 
  
  validates_presence_of :fees
  validates_length_of :fees, :in => 1..3
  
  
                      
	has_many :attendances
	has_many :users, :through => :attendances
end
